/**
 * 
 */
package ac.notification.ui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Rectangle2D;

import javax.swing.JPanel;

/**
 * @author Ankush
 *
 */
public class GradientPanel extends JPanel {


	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public static Color SET_I 	= new Color(167,255,80);
	public static Color SET_II 	= new Color(180,180,220);
	public static Color SET_III = new Color(145,175,230);
	
	
	private Color gradLow = SET_I;
	
	public GradientPanel()
	{
		super(new BorderLayout());
		setOpaque(false);
	}
	
	public void paintComponent(Graphics g)
	{
		
		//Take instance of graphics2d for more elaborative drawing.
		Graphics2D g2d = (Graphics2D) g; 
		
		//Set Rendering hint
		g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
		g2d.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY);
		g2d.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);
		
		//Gradient
		GradientPaint gradientPaint = new GradientPaint(getWidth(),0,gradLow.darker(), getWidth(), getHeight()-10, gradLow);
		g2d.setPaint(gradientPaint);
		
		//Draw some graphics
		//g2d.setColor(new Color(241,143,102));
		g2d.fill(new Rectangle2D.Double(0, 0, getWidth(), getHeight()));
		g2d.setColor(Color.WHITE); 
		g2d.fill(new Ellipse2D.Double(2, 2, getWidth()-4,3));
		//super.paintComponents(g);	
	}
	
	
}
